<template>
  <!-- Vue2中组件缓存 -->
  <!-- <keep-alive include="Home">
    <router-view></router-view>
  </keep-alive> -->

  <!-- Vue3中组件缓存 -->
  <router-view v-slot="{ Component }">
    <keep-alive include="Home">
      <component :is="Component" />
    </keep-alive>
  </router-view>
</template>

<script>
export default {
  name: "App",
};
</script>

<style lang="less">
html,
body{
  min-height: 100%;
  overflow-x: hidden;
  background: #f4f4f4;
}
#app{
  margin: 0 auto;
  background: #fff;
}
</style>